﻿namespace LinqBusinessObjectBuilder.Generator
{
    internal class PropertyInfo
    {
        private string m_Type;

        public string PropertyName { get; set; }
        public bool IsRequired { get; set; }
        public bool IsReadOnly { get; set; }
        public int? MaxLength { get; set; }
        public bool IsIdentity { get; set; }
        public bool IsEntityRef { get; set; }

        public string Type
        {
            get { return m_Type; }
            set
            {
                m_Type = SqlMetalModifier.ConvertTypeToNullable(value);
            }
        }

        public override string ToString()
        {
            return string.Format("{0} {1}; Identity={2}, ReadOnly={3}, Required={4}",
                m_Type, PropertyName, IsIdentity, IsReadOnly, IsRequired);
        }
    }
}